﻿<%@ Page Language="C#" AutoEventWireup="true" 
CodeBehind="Default.aspx.cs" Inherits="Merbla.WebForms._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Namespace="Merbla.WebForms.AjaxControls" Assembly="Merbla.WebForms" TagPrefix="cc1"  %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
      
    <script type="text/javascript">


         
        function OnClick(sender, e) {

            var x = sender.get_parameterName();

            var y = sender.get_parameterValue();

            alert(x);
            alert(y);

        }
        function changeValue() {
            var control = $find("<%=Test.ClientID %>");
            var val = control.set_parameterValue("2");

        }

//        function $$(id, context) {
//            var el = $("#" + id, context);
//            if (el.length < 1)
//                el = $("[id$=_" + id + "]", context);
//            return el;
//        }

        //alert($$("txtSymbol").attr("id"));
    </script>   
    
    
</head>
<body>
    <form id="form1" runat="server">
    
    <asp:ScriptManager ID="_scriptManager" runat="server"/>
     
    <div>
        <cc1:ItemControl 
            runat="server" 
            ID="Test"  
            ParameterName="MyParam"
            ParameterValue ="1" 
            Visible="true" ClientClickFunction="OnClick">
        </cc1:ItemControl>
        <input type="button" value="ChangeValue" onclick="changeValue()" />    
    </div>
    </form>
</body>
</html>

